package core;

import strategies.DepthFirstLeftToRightSearchStrategy;
import strategies.SearchStrategy;

public class Tree
{
	public Tree(int nb_elements_per_node, int max_level)
	{
		root_node = new Node(nb_elements_per_node, 0, max_level);
		search_strategy = new DepthFirstLeftToRightSearchStrategy();
	}
	
	public void change_strategy(SearchStrategy search)
	{
		search_strategy = search;
	}
	
	public boolean find_element(int data_to_search)
	{
		return search_strategy.data_exist_in_tree(data_to_search, this);
	}
	
	public static final int get_nb_nodes()
	{
		return Node.get_nb_nodes();
	}
	
	public final Node get_root_node()
	{
		return root_node;
	}
	
	private Node root_node;
	
	private SearchStrategy search_strategy;

	public String print_search_strategy() {
		// TODO Auto-generated method stub
		return search_strategy.print_strategy_name();
	}
	

	
}

/*
ROOT
0
###
1 2 3
level_rank = 3
node_rank = 2 + 3 + 
1 2 3 | 
###

*/